import request from '@/utils/request'
export const getArticles = params => request({
    method: 'GET',
    url: '/v1_0/articles',
    params
})
export const getArticleById = id => request({
    url: `/v1_0/articles/${id}`,
    timeout: 500
})
export const addCollect = id => request({
    method: "POST",
    url: '/v1_0/article/collections',
    data: {
        target: id
    }
})
export const deleteCollect = id => request({
    method: "DELETE",
    url: "/v1_0/article/collections/${id}"
})
export const addLike = id => request({
    method: 'POST',
    url: '/v1_0/article/likings',
    data: {
        target: id
    }
})
export const deleteLike = id => request({
    method: 'DELETE',
    url: `/v1_0/article/likings/${id}`
})